import java.util.*;

public class Grader {
    public static void main(String[] args) {
        System.out.println("This program converts two scores into grades.");
        System.out.println();
        for (int i = 1; i <= 2; i++) {
            output(i);
        }
    }
    
    public static void output(int count) {
        System.out.println("Student " + count);
        Scanner input = new Scanner(System.in);
        System.out.print("What score did you get? ");
        int score = (int) Math.round(input.nextDouble());
        System.out.println("You received a grade of " + grade(score));
        passed(grade(score));
        advanced(grade(score));
        System.out.println();
    }
    
    public static double grade(int score) {
        if (score < 60) {
            return 0.0;
        }
        else if (score >= 95) {
            return 4.0;
        }
        else if (score >= 60 && score <= 62) {
            return 0.7;
        }
        else {
            return ((score - 63) * 0.1) + 0.7;
    }
}
    
    public static void advanced(double grade) {
        if (grade >= 2.0) {
            System.out.println("You may advance to the next course");
        }
        else {
            System.out.println("You must take the course again");
        }
    }
    
    public static void passed(double grade) {
        if (grade > 0.0) {
            System.out.println("You passed the course");
        }
        else {
            System.out.println("You failed the course");
        }
    }
}